package cn.zhl.设计模式.单例;

/**
 * @program: demos
 * @description: 单例设计模式
 * @author: 刘振华
 * @create: 2021-03-05 16:35
 **/
public class SigletonEnum {
	public static void main(String[] args) {
		SingEnum se1 = SingEnum.INSTANCE;
		SingEnum se2 = SingEnum.INSTANCE;
		System.out.println(se1 == se2);

		System.out.println(se1.hashCode());
		System.out.println(se2.hashCode());

		se1.say();
		se2.say();
	}
}
enum SingEnum{
	INSTANCE;
	public void say(){
		System.out.println("ok!");
	}
}
